var getRootPath = function() {
	var pathName = window.location.pathname.substring(1);
	var webName = pathName == '' ? '' : pathName.substring(0, pathName
			.indexOf('/'));
	return window.location.protocol + '//' + window.location.host + '/'
			+ webName + '/';
};

var selectAll = function(currentObj,attr){
	if(currentObj.checked){
		$("input:checkbox[checkAttr="+attr+"]").attr("checked","checked");
	}else{
		$("input:checkbox[checkAttr="+attr+"]").attr("checked","");
	}
};

var singleSelect = function(currentObj){
	var flag = true;
	if(currentObj.checked){
		$("input:checkbox[checkAttr="+$(currentObj).attr("checkAttr")+"]").each(function(index,item){
			if(!item.checked){
				$("#selectAllCheckbox").attr("checked","");	
				flag = false;
			}
		});
		if(flag){
			$("#selectAllCheckbox").attr("checked","checked");	
		}
	}else{
		$("#selectAllCheckbox").attr("checked","");	
	}
};